﻿using GalaSoft.MvvmLight;
using IService.Conversation;
using System.Collections.ObjectModel;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Main;

namespace ViewModel.Conversation
{
    public class ConversationViewModel:ViewModelBase
    {
        public ConversationViewModel(IConversationService service)
        {
            _service = service;
            Conversations = new ObservableCollection<Model.Conversation.Conversation>
                (
                    new List<Model.Conversation.Conversation>
                    {
                        new Model.Conversation.Conversation()
                        {
                            Friend= new Friend() {NickName="James Raynor",RemarkName="吉姆雷诺",UserId="100001",Emotion="有点儿过去的样子"},
                        },
                        new Model.Conversation.Conversation()
                        {
                            Friend=  new Friend() {NickName="Nova",RemarkName="诺娃",UserId="100002",Emotion="诺娃在此!"},
                        },
                        new Model.Conversation.Conversation()
                        {
                            Friend= new Friend() {NickName="Artanis",RemarkName="阿塔尼斯",UserId="100003",Emotion="EnTaro Tasadar"},
                        },
                        new Model.Conversation.Conversation()
                        {
                            Friend= new Friend() {NickName="Artanis",RemarkName="卡拉克斯",UserId="100004",Emotion="以艾顿之名!"},
                        },
                        new Model.Conversation.Conversation()
                        {
                            Friend= new Friend() {NickName="Kerrigan",RemarkName="凯瑞甘",UserId="100005",Emotion="我即是虫群"},
                        },
                        new Model.Conversation.Conversation()
                        {
                            Friend= new Friend() {NickName="Zeratul",RemarkName="泽拉图",UserId="100006",Emotion="追寻预言的真相"},
                        },
                    }
                );
        }
        #region 服务
        IConversationService _service;
        #endregion
        #region 属性
        private ObservableCollection<Model.Conversation.Conversation> _conversations;

        public ObservableCollection<Model.Conversation.Conversation> Conversations
        {
            get { return _conversations; }
            set
            {
                _conversations = value;
                RaisePropertyChanged(() => Conversations);
            }
        }

        #endregion
    }
}
